import request from '@/utils/request'

// 查询重大危险源目录分页
export function pageSource(query) {
  return request({
    url: '/risk/source/page',
    method: 'get',
    params: query,
    factoryId:true,
  })
}

// 查询重大危险源目录列表
export function listSource(query) {
  return request({
    url: '/risk/source/list',
    method: 'get',
    params: query,
    factoryId:true,
  })
}

// 查询重大危险源目录详细
export function getSource(id) {
  return request({
    url: '/risk/source/info/' + id,
    method: 'get'
  })
}

// 新增重大危险源目录
export function addSource(data) {
  return request({
    url: '/risk/source',
    method: 'post',
    data: data
  })
}

// 修改重大危险源目录
export function updateSource(data) {
  return request({
    url: '/risk/source',
    method: 'put',
    data: data
  })
}

// 删除重大危险源目录
export function delSource(data) {
  return request({
    url: '/risk/source/remove/batch',
    method: 'delete',
    data
  })
}

// 导出重大危险源目录
export function exportSource(query) {
  return request({
    url: '/risk/source/export',
    method: 'get',
    params: query
  })
}

// 下载模板重大危险源目录
export function downImportTemplate() {
  return request({
    url: '/risk/source/importTemplate',
    method: 'get'
  })
}
